import request from '@/utils/request'
import type { reqTag } from './type'
// 枚举接口
enum API {
  ARTICLE = '/article',
  GET_ARTICLE_LIST = '/article/getComments/',
  PUSH_ARTICLE_COMMENT = '/article/pushComment',
  TREE_LIST = '/article/getTreeList',
}
// 获取tag列表
export const getArticle = (id: any) => request.get<any, reqTag>(API.ARTICLE, { params: { id } })
// 获取文章列表
export const getArticleComments = (id: any) => request.get<any, reqTag>(API.GET_ARTICLE_LIST + id)
// 提交评论
export const pushArticleComment = (data: any) => request.post<any, reqTag>(API.PUSH_ARTICLE_COMMENT, data)
// 提交文章
export const pushArticle = (data: any) => request.post<any, reqTag>(API.ARTICLE, data)
// 获取树
export const getArticleTree = () => request.get<any, reqTag>(API.TREE_LIST)
